require.config({
    baseUrl: '../javascripts/library', // 基础路径
    paths: {
        jquery: 'jquery',
        axios: 'axios',
        require: 'require'
    },

});

require(['jquery', 'axios'], function($, axios) {

    let id = location.search.split('=')[1];
    axios.get('../product/getItem', { params: { product_id: id } }).then(res => {
        let data = res.data[0];
        let picture = JSON.parse(data.picture);

        $('.smallbox').html(` 
        <div><img src="../${picture[1].src}"></div>

        </div>
        
        `)

        $('.price').html(` 
        <div>${data.price}</div>
        
        `)

        $('.picture').html(` 
        <div>${data.detalis}</div>
        <div>${data.detalis}</div>
        `)

    }).catch(err => {
        console.log(err);
    });
});


require(['cookie'], function(cookie) {
    console.log(cookie);
});